package com.gitee.huanminabc.utils_tools.class_extend.javassist.cut;

import com.gitee.huanminabc.utils_tools.class_extend.javassist.ClassAspect;
import lombok.extern.slf4j.Slf4j;

/**
 * @author huanmin
 * @date 2024/2/27
 */
@Slf4j
public class AllClassCodeTimeLogCut implements ClassAspect {
    private long start;
    @Override
    public void before(Class<?> targetClass, String methodName, Object[] args) {
        this.start = System.currentTimeMillis();
    }

    @Override
    public void afterReturning(Class<?> targetClass, String methodName, Object[] args, Object result) {
        log.info(targetClass.getName()+"."+methodName+" -执行耗时:  " + (System.currentTimeMillis() - start)+"ms");
    }


}
